<style>
    .friends li a .bg{    
        display: none;
        width: 100%;
        height: 46px;
        background: #777;
        position: absolute;
        top: 0;
        left: 0;
        z-index: 998;
    }

    #body{
        padding-top: 0 !important;
    }

    .h-top{
        padding-bottom: 0 !important;
    }
    #waiting-msg{
        height:30px;
        position:relative;
    }
    #waiting-msg .hide{
        position:absolute;
        bottom:0;
    }
</style>
<link href="<?php echo CSS_PATH; ?>/jquery-ui.css" rel="stylesheet" type="text/css"/>

<div id="body" class="layout">

    <div class="wrap">
        <div class="left">
            <div class="ce-wrap" >
                <form id="demoForm" method="post" action="<?php echo!empty($this->event_id) ? $this->baseUrl("ajax/event/id/" . $this->event_id) : $this->baseUrl("ajax/event"); ?>" class="bbq" enctype="multipart/form-data">
                    <div id="step1" class="step">
                        <div class="label">
                            <strong>Event <span class="blu">Title</span></strong>
                        </div>
                        <div class="field">
                            <div class="fl icon"><img src="<?php echo IMAGES_URL; ?>active-icon.png" alt="active" /></div>
                            <div class="f-input fl">
                                <input type="text" name="event_title" maxlength="45" placeholder="Event Title" id="event_title" class="radius input" onfocus="this.style.borderColor = '#1996d4'" onblur="this.style.borderColor = '#cfcfcf'" value="<?php echo $this->event_title; ?>"/>

                            </div>
                            <div class="cf"></div>
                            <div class="note">30 characters max</div>
                        </div>
                        <p><br/></p>
                        <div class="label">
                            <strong>Category</strong>
                        </div>
                        <div class="field">
                            <div class="fl icon"><img src="<?php echo IMAGES_URL; ?>cate-icon.png" alt="active" /></div>
                            <div class="f-input fl">

                                <div class="radius f-dropdown select" id="cat-id">
                                    <p class="blu">&nbsp;&nbsp;&nbsp;<?php echo!empty($this->category_name) ? $this->category_name : "-- Select --"; ?></p>
                                    <a href="#" class="arrow"></a>
                                    <div class="dropdown">
                                        <ul>
                                            <li>-- Select --</li>
                                            <?php
                                                foreach ($this->categoryArr as $cKey => $cValue)
                                                {
                                                    ?>
                                                    <li data-target="event_cat_id" data-val ="<?php echo $cValue['category_id'] ?>">&nbsp;&nbsp;&nbsp;<?php echo $cValue['category_name'] ?></li>
                                                    <?php
                                                }
                                            ?>
                                        </ul>
                                    </div>
                                </div>
                                <input type="hidden" name="event_cat_id" id="event_cat_id" style="height:25px;" value="<?php echo $this->event_cat_id; ?>">

                            </div>
                            <div class="cf"></div>
                        </div>
                        <p><br/></p>
                        <div class="label">
                            <strong>Subcategory</strong>
                        </div>
                        <div class="field">
                            <div class="fl icon"><img src="<?php echo IMAGES_URL; ?>sub-cate-icon.png" alt="active" /></div>
                            <div class="f-input fl">
                                <div class="f-input fl subcategory">
                                    <input type="text" name="event_subcat_id" placeholder="Event Subcategory" id="event_subcat_id" class="radius input" onfocus="this.style.borderColor = '#1996d4'" onblur="this.style.borderColor = '#cfcfcf';" value="<?php echo $this->event_subcat_id; ?>" style="width: 98%;"/>
                                </div>

                            </div>
                            <div class="cf"></div>
                        </div>
                        <p><br /><br /></p>
                        <div class="field">
                            <div class="fl icon"><img src="<?php echo IMAGES_URL; ?>group-icon-blu.png" alt="active" /></div>
                            <div class="f-input fl">
                                <div class="group-box radius">
                                    <div class="title">Group <span class="blu">Size</span></div>
                                    <div class="group-content">
                                        <div>
                                            <label class="blu fl radio">
                                                <input type="radio" name="event_group_type" id="event_group_type_limited" <?php echo $this->event_group_type == 'limited' ? "checked='checked'" : ""; ?> value="limited"/><i>&nbsp;&nbsp;Limited</i></label>
                                            <input type="text" name="event_group_size" id="event_group_size"  class="input radius" value="<?php echo $this->event_group_size; ?>"/>
                                            <span class="note">Enter the Size of the Group</span>
                                            <div class="cf"></div>
                                        </div>
                                        <div>
                                            <label class="blu fl radio"><input type="radio" name="event_group_type" id="event_group_type_unlimited" <?php echo $this->event_group_type != 'limited' ? "checked='checked'" : ""; ?>  value="unlimited"/><i>&nbsp;&nbsp;Unlimited</i></label>
                                        </div>
                                        <div class="cf"></div>
                                    </div>
                                </div>
                            </div>
                            <div class="cf"></div>
                        </div>
                        <p><br /><br /></p>
                        <div class="field">
                            <div class="fl icon"><img src="<?php echo IMAGES_URL; ?>location-icon.png" alt="active" /></div>
                            <div class="f-input fl">
                                <div class="group-box radius glocation">
                                    <div class="title">Location <span class="blu">Address</span></div>
                                    <div class="group-content">
                                        <div class="addr">
                                            <input type="text" name="event_address" id="event_address" class="input radius" placeholder="Event Address" onfocus="this.style.borderColor = '#1996d4'" onblur="this.style.borderColor = '#cfcfcf'" style="border-color: rgb(207, 207, 207);" value="<?php echo $this->event_address; ?>" />
                                            <p class="note">Address</p>
                                        </div>
                                        <div class="s">
                                            <!--                                            <div class="city fl">
                                                                                            <p>
                                                                                                <input type="text" name="event_city" id="event_city" class="input radius" onfocus="this.style.borderColor = '#1996d4'" onblur="this.style.borderColor = '#cfcfcf'" style="border-color: rgb(207, 207, 207);" value="<?php echo $this->event_city; ?>" />
                                                                                            </p>
                                                                                            <p class="note">City</p>
                                                                                        </div>
                                                                                        <div class="state fl">
                                                                                            <p>
                                                                                                <input type="text" name="event_state" id="event_state" class="input radius" onfocus="this.style.borderColor = '#1996d4'" onblur="this.style.borderColor = '#cfcfcf'" style="border-color: rgb(207, 207, 207);" value="<?php echo $this->event_state; ?>"/>
                                                                                            </p>
                                                                                            <p class="note">State</p>
                                                                                        </div>
                                                                                        <div class="state fl">
                                                                                            <p>
                                                                                                <input type="text" name="event_country" id="event_country" class="input radius" onfocus="this.style.borderColor = '#1996d4'" onblur="this.style.borderColor = '#cfcfcf'" style="border-color: rgb(207, 207, 207);" value="<?php echo $this->event_country; ?>"/>
                                                                                            </p>
                                                                                            <p class="note">Country</p>
                                                                                        </div>-->
                                            <div class="state fl">
                                                <p>
                                                    <input type="text" name="event_location" id="address" placeholder="City/State/Country" class="input radius event_location_input" style="width: 250px;" onfocus="this.style.borderColor = '#1996d4'" onblur="this.style.borderColor = '#cfcfcf'" style="border-color: rgb(207, 207, 207);" value="<?php echo $this->event_country; ?>"/>
                                                </p>
                                                <p class="note">Location</p>
                                            </div>
                                            <div class="cf"></div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                            <div class="cf"></div>
                        </div>
                        <p><br /><br /></p>
                        <div class="field">
                            <div class="fl icon"><img src="<?php echo IMAGES_URL; ?>calendar-icon.png" alt="active" /></div>
                            <div class="f-input fl">
                                <div class="group-box radius">
                                    <div class="title">Date</div>
                                    <div class="group-content">
                                        <div class="gcleft fl">
                                            <!--                                            <label class="blu fl radio">
                                                                                            <input type="radio" name="rdate" value="recurring"/><span><i>Recurring</i></span>
                                                                                        </label>
                                                                                        <div class="fl recurring active" id="recurring">
                                                                                            <div id="recurr-1">
                                                                                                <div class="fl">
                                                                                                    <div class="radius f-dropdown select">
                                                                                                        <p class="text"><?php echo!empty($this->event_date->day[0]) ? $this->event_date->day[0] : "01"; ?></p>
                                                                                                        <a href="#" class="arrow"></a>
                                                                                                        <div class="dropdown">
                                                                                                            <ul>
                                            <?php
                                                for ($i = 1; $i <= 31; $i++)
                                                {
                                                    ?>    <li data-target="recurring_date_1" data-val ="<?php echo $i; ?>"><?php echo $i < 10 ? "0" . $i : $i; ?></li>
                                                    <?php
                                                }
                                            ?>
                                                                                                            </ul>
                                                                                                        </div>
                                                                                                        <input type="hidden" name="date[]" id="recurring_date_1" value="<?php echo!empty($this->event_date->day[0]) ? $this->event_date->day[0] : "01"; ?> ">
                                                                                                    </div>
                                                                                                    <p class="note">Date</p>
                                                                                                </div>
                                                                                                <div class="fl">
                                                                                                    <div class="radius f-dropdown select">
                                                                                                        <p class="text"><?php echo!empty($this->event_date->month[0]) ? $this->event_date->month[0] : date('M', time()); ?></p>
                                                                                                        <a href="#" class="arrow"></a>
                                                                                                        <div class="dropdown">
                                                                                                            <ul>
                                            <?php
                                                for ($i = 0; $i < 12; $i++)
                                                {
                                                    ?>
                                                                                                                                                                                                                                                                                                                                                                        <li data-target="recurring_month_1" data-val ="<?php echo date('M', strtotime(' +' . $i . ' month', time())); ?>"><?php echo date('M', strtotime(' +' . $i . ' month', time())); ?></li>
                                                    <?php
                                                }
                                            ?>
                                                                                                            </ul>
                                                                                                        </div>
                                                                                                        <input type="hidden" name="month[]" id="recurring_month_1" value="<?php echo!empty($this->event_date->month[0]) ? $this->event_date->month[0] : date('M', time()); ?>" >
                                                                                                    </div>
                                                                                                    <p class="note">Month</p>
                                                                                                </div>
                                                                                                <div class="fl">
                                                                                                    <div class="radius f-dropdown select">
                                                                                                        <p class="text"><?php echo!empty($this->event_date->year[0]) ? $this->event_date->year[0] : date('Y'); ?></p>
                                                                                                        <a href="#" class="arrow"></a>
                                                                                                        <div class="dropdown">
                                                                                                            <ul>
                                            <?php
                                                for ($i = 0; $i <= 5; $i++)
                                                {
                                                    ?>    
                                                                                                                                                                                                                                                                                                                                                                        <li data-target="recurring_year_1" data-val="<?php echo date("Y", strtotime('+' . $i . ' year', time())); ?>"><?php echo date("Y", strtotime('+' . $i . ' year', time())); ?></li>
                                                    <?php
                                                }
                                            ?>   
                                                                                                            </ul>
                                                                                                        </div>    
                                                                                                        <input type="hidden" name="year[]" id="recurring_year_1" value="<?php echo!empty($this->event_date->year[0]) ? $this->event_date->year[0] : date('Y'); ?>">
                                                                                                    </div> 
                                                                                                    <p class="note">Year</p>
                                                                                                </div>
                                                                                                <a href="#" rel="recurr-1"  class="remove-date"><img src="<?php echo IMAGES_PATH; ?>/del-msg-icon.png"/></a>
                                                                                                <div class="cf"></div>
                                                                                            </div>
                                            
                                                                                            <div id="recurr-2">
                                                                                                <p><br /><br /></p>
                                                                                                <div class="fl">
                                                                                                    <div class="radius f-dropdown select">
                                                                                                        <p class="text"><?php echo!empty($this->event_date->day[1]) ? $this->event_date->day[1] : "01"; ?></p>
                                                                                                        <a href="#" class="arrow"></a>
                                                                                                        <div class="dropdown">
                                                                                                            <ul>
                                            <?php
                                                for ($i = 1; $i <= 31; $i++)
                                                {
                                                    ?>    <li data-target="recurring_date_2" data-val="<?php echo $i < 10 ? "0" . $i : $i; ?>"><?php echo $i < 10 ? "0" . $i : $i; ?></li>
                                                    <?php
                                                }
                                            ?>
                                                                                                            </ul>
                                                                                                        </div>
                                                                                                        <input type="hidden" name="date[]" id="recurring_date_2" value="<?php echo!empty($this->event_date->day[1]) ? $this->event_date->day[1] : "01"; ?>">
                                                                                                    </div>
                                                                                                    <p class="note">Date</p>
                                                                                                </div>
                                                                                                <div class="fl">
                                                                                                    <div class="radius f-dropdown select">
                                                                                                        <p class="text"><?php echo!empty($this->event_date->month[1]) ? $this->event_date->month[1] : date('M', time()); ?></p>
                                                                                                        <a href="#" class="arrow"></a>
                                                                                                        <div class="dropdown">
                                                                                                            <ul>
                                            <?php
                                                for ($i = 0; $i < 12; $i++)
                                                {
                                                    ?>
                                                                                                                                                                                                                                                                                                                                                                        <li data-target="recurring_month_2" data-val ="<?php echo date('M', strtotime(' +' . $i . ' month', time())); ?>"><?php echo date('M', strtotime(' +' . $i . ' month', time())); ?></li>
                                                    <?php
                                                }
                                            ?>
                                            
                                                                                                            </ul>
                                                                                                        </div>
                                                                                                        <input type="hidden" name="month[]" id="recurring_month_2" value="<?php echo!empty($this->event_date->month[1]) ? $this->event_date->month[1] : date('M', time()); ?>">
                                                                                                    </div>
                                                                                                    <p class="note">Month</p>
                                                                                                </div>
                                                                                                <div class="fl">
                                                                                                    <div class="radius f-dropdown select">
                                                                                                        <p class="text"><?php echo!empty($this->event_date->year[1]) ? $this->event_date->year[1] : date('Y'); ?></p>
                                                                                                        <a href="#" class="arrow"></a>
                                                                                                        <div class="dropdown">
                                                                                                            <ul>
                                            <?php
                                                for ($i = 0; $i <= 5; $i++)
                                                {
                                                    ?>    
                                                                                                                                                                                                                                                                                                                                                                        <li data-target="recurring_year_2" data-val="<?php echo date("Y", strtotime('+' . $i . ' year', time())); ?>"><?php echo date("Y", strtotime('+' . $i . ' year', time())); ?></li>
                                                    <?php
                                                }
                                            ?>   
                                                                                                            </ul>
                                                                                                        </div>    
                                                                                                        <input type="hidden" name="year[]" id="recurring_year_2" value="<?php echo!empty($this->event_date->year[1]) ? $this->event_date->year[1] : date('Y'); ?>">
                                                                                                    </div> 
                                                                                                    <p class="note">Year</p>
                                                                                                </div>
                                                                                                <a href="#" rel="recurr-2"  class="remove-date"><img src="<?php echo IMAGES_PATH; ?>/del-msg-icon.png"/></a>
                                                                                                <div class="cf"></div>
                                                                                            </div>
                                            
                                            <?php
                                                if (!empty($this->event_date))
                                                    for ($_i = 2; $_i < count($this->event_date->day); $_i++)
                                                    {
                                                        ?>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                <div id="recurr-<?php echo $_i + 1; ?>">
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    <div class="fl">
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        <div class="radius f-dropdown select">
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            <p class="text"><?php echo!empty($this->event_date->day[$_i]) ? $this->event_date->day[$_i] : "01"; ?></p>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            <a href="#" class="arrow"></a>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            <div class="dropdown">
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                <ul>
                                                        <?php
                                                        for ($i = 1; $i <= 31; $i++)
                                                        {
                                                            ?>    <li data-target="recurring_date_<?php echo $_i + 1; ?>" data-val="<?php echo $i < 10 ? "0" . $i : $i; ?>"><?php echo $i < 10 ? "0" . $i : $i; ?></li>
                                                            <?php
                                                        }
                                                        ?>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                </ul>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            </div>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            <input type="hidden" name="date[]" id="recurring_date_<?php echo $_i + 1; ?>" value="<?php echo!empty($this->event_date->day[$_i]) ? $this->event_date->day[$_i] : "01"; ?>">
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        </div>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        <p class="note">Date</p>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    </div>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    <div class="fl">
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        <div class="radius f-dropdown select">
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            <p class="text"><?php echo!empty($this->event_date->month[$_i]) ? $this->event_date->month[$_i] : date('M', time()); ?></p>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            <a href="#" class="arrow"></a>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            <div class="dropdown">
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                <ul>
                                                        <?php
                                                        for ($i = 0; $i < 12; $i++)
                                                        {
                                                            ?>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                <li data-target="recurring_month_<?php echo $_i + 1; ?>" data-val ="<?php echo date('M', strtotime(' +' . $i . ' month', time())); ?>"><?php echo date('M', strtotime(' +' . $i . ' month', time())); ?></li>
                                                            <?php
                                                        }
                                                        ?>
                                                                                                                                                                                                                    
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                </ul>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            </div>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            <input type="hidden" name="month[]" id="recurring_month_<?php echo $_i + 1; ?>" value="<?php echo!empty($this->event_date->month[$_i]) ? $this->event_date->month[$_i] : date('M', time()); ?>">
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        </div>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        <p class="note">Month</p>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    </div>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    <div class="fl">
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        <div class="radius f-dropdown select">
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            <p class="text"><?php echo!empty($this->event_date->year[$_i]) ? $this->event_date->year[$_i] : date('Y'); ?></p>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            <a href="#" class="arrow"></a>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            <div class="dropdown">
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                <ul>
                                                        <?php
                                                        for ($i = 0; $i <= 5; $i++)
                                                        {
                                                            ?>    
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                <li data-target="recurring_year_<?php echo $_i + 1; ?>" data-val="<?php echo date("Y", strtotime('+' . $i . ' year', time())); ?>"><?php echo date("Y", strtotime('+' . $i . ' year', time())); ?></li>
                                                            <?php
                                                        }
                                                        ?>   
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                </ul>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            </div>    
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            <input type="hidden" name="year[]" id="recurring_year_<?php echo $_i + 1; ?>" value="<?php echo!empty($this->event_date->year[$i]) ? $this->event_date->year[$i] : date('Y'); ?>">
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        </div> 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        <p class="note">Year</p>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    </div>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    <a href="#" rel="recurr-<?php echo $_i + 1; ?>"  class="remove-date"><img src="<?php echo IMAGES_PATH; ?>/del-msg-icon.png"/></a>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    <div class="cf"></div>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    <p><br /><br /></p>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                </div>
                                                        <?php
                                                    }
                                            ?>        
                                                                                            <div class="cf"></div>
                                            
                                                                                        </div>
                                                                                        <div class="cf"></div>
                                                                                        <div class="add-more-date"><a href="javascript:;" class="blu tlink" onclick="addRecurringDates();">+ Add more dates</a></div>-->

                                            <label class="blu fl radio">
                                                <input type="radio" name="rdate" checked="checked"  value="single" <?php echo $this->event_date_type == 'single' ? "checked='checked'" : ""; ?>/><i>Single Term Event</i>
                                            </label>
                                            <div class="fl recurring active">
                                                <div class="fl">
                                                    <div class="radius f-dropdown select">
                                                        <p class="text"><?php echo!empty($this->event_date->day[0]) ? $this->event_date->day[0] : "01"; ?></p>
                                                        <a href="#" class="arrow"></a>
                                                        <div class="dropdown">
                                                            <ul>
                                                                <?php
                                                                    for ($i = 1; $i <= 31; $i++)
                                                                    {
                                                                        ?>    
                                                                        <li data-target="single_date" data-val="<?php echo $i < 10 ? "0" . $i : $i; ?>"><?php echo $i < 10 ? "0" . $i : $i; ?></li>
                                                                        <?php
                                                                    }
                                                                ?>
                                                            </ul>
                                                        </div>
                                                        <input type="hidden" name="sdate[]" id="single_date" value="<?php echo!empty($this->event_date->day[0]) ? $this->event_date->day[0] : "01"; ?>">
                                                    </div>
                                                    <p class="note">Date</p>
                                                    <label for="single_date" generated="true" class="error note" style="display:none;">Date must be higher than current date</label>
                                                </div>
                                                <div class="fl">
                                                    <div class="radius f-dropdown select">
                                                        <p class="text"><?php echo!empty($this->event_date->month[0]) ? $this->event_date->month[0] : date('M', time()); ?></p>
                                                        <a href="#" class="arrow"></a>
                                                        <div class="dropdown">
                                                            <ul>
                                                                <?php
                                                                    for ($i = 0; $i < 12; $i++)
                                                                    {
                                                                        ?>
                                                                        <li data-target="single_month" data-val ="<?php echo date('M', strtotime(' +' . $i . ' month', time())); ?>"><?php echo date('M', strtotime(' +' . $i . ' month', time())); ?></li>
                                                                        <?php
                                                                    }
                                                                ?>

                                                            </ul>
                                                        </div>
                                                        <input type="hidden" name="smonth[]" id="single_month" value="<?php echo!empty($this->event_date->month[0]) ? $this->event_date->month[0] : date('M', time()); ?>">
                                                    </div>
                                                    <p class="note">Month</p>
                                                </div>
                                                <div class="fl">
                                                    <div class="radius f-dropdown select">
                                                        <p class="text"><?php echo!empty($this->event_date->year[0]) ? $this->event_date->year[0] : date('Y'); ?></p>
                                                        <a href="#" class="arrow"></a>
                                                        <div class="dropdown">
                                                            <ul>
                                                                <?php
                                                                    for ($i = 0; $i <= 5; $i++)
                                                                    {
                                                                        ?>    
                                                                        <li data-target="single_year" data-val="<?php echo date("Y", strtotime('+' . $i . ' year', time())); ?>"><?php echo date("Y", strtotime('+' . $i . ' year', time())); ?></li>
                                                                        <?php
                                                                    }
                                                                ?>   
                                                            </ul>
                                                        </div>    
                                                        <input type="hidden" name="syear[]" id="single_year" value="<?php echo!empty($this->event_date->year[0]) ? $this->event_date->year[0] : date('Y'); ?>">
                                                    </div> 
                                                    <p class="note">Year</p>
                                                </div>
                                                <div class="cf"></div>
                                            </div>
                                            <div class="cf"></div>
                                        </div>
                                        <div class="cf"></div>
                                    </div>
                                </div>
                            </div>
                            <div class="cf"></div>
                        </div>
                        <p><br /><br /></p>
                        <div class="label">
                            <strong>Time</strong>
                        </div>
                        <div class="field">
                            <div class="fl icon"><img src="<?php echo IMAGES_URL; ?>clock-icon-blue.png" alt="active" /></div>
                            <div class="f-input fl">
                                <div class="group-content">
                                    <div class="gcleft fl">

                                        <div class="radius f-dropdown fl select">
                                            <p class="text">1</p>
                                            <a href="#" class="arrow"><img src="<?php echo IMAGES_URL; ?>arrow-dropdown.png" alt="arrow"></a>
                                            <div class="dropdown">
                                                <ul>
                                                    <?php
                                                        for ($i = 1; $i <= 12; $i++)
                                                        {
                                                            ?>    
                                                            <li data-target="hour" data-val="<?php echo $i; ?>"><?php echo $i; ?></li>
                                                            <?php
                                                        }
                                                    ?>   
                                                </ul>
                                            </div>   
                                            <input type="hidden" name="hour" id="hour" value="1">
                                            <p class="note">Hour</p>

                                        </div>

                                        <div class="radius f-dropdown fl select">
                                            <p class="text">00</p>
                                            <a href="#" class="arrow"><img src="<?php echo IMAGES_URL; ?>arrow-dropdown.png" alt="arrow"></a>
                                            <p class="note">Minutes</p>
                                            <div class="dropdown">
                                                <ul>
                                                    <?php
                                                        for ($i = 0; $i <= 60; $i++)
                                                        {
                                                            ?>    
                                                            <li data-target="minute" data-val="<?php echo $i < 10 ? "0" . $i : $i; ?>"><?php echo $i < 10 ? "0" . $i : $i; ?></li>
                                                            <?php
                                                        }
                                                    ?>   
                                                </ul>
                                            </div>
                                            <input type="hidden" name="minute" id="minute" value="00">
                                        </div>
                                        <div class="fl">
                                            <span class="pmbutton">
                                                <a href="#" class="am" data-target="ampm" data-val="am">am</a>
                                                <a href="#" class="pm selected" data-target="ampm" data-val="pm" >pm</a>
                                            </span>
                                            <input type="hidden" name="ampm" id="ampm" value="pm">
                                        </div>
                                        <div class="cf"></div>
                                    </div>
                                    <div class="cf"></div>
                                </div>
                            </div>
                            <div class="cf"></div>
                        </div>
                        <p><br /><br /></p>
                        <div class="label">
                            <strong>When do you want to end this Event?</strong>
                        </div>
                        <div class="field">
                            <div class="fl icon"><img src="<?php echo IMAGES_URL; ?>calendar-icon.png" alt="active" /></div>
                            <div class="f-input fl">
                                <div class="group-content gcleft">

                                    <div class="fl">
                                        <div class="radius f-dropdown select">
                                            <p class="text"><?php echo!empty($this->event_end_date->day[0]) ? $this->event_end_date->day[0] : "01"; ?></p>
                                            <a href="#" class="arrow"></a>
                                            <div class="dropdown">
                                                <ul>
                                                    <?php
                                                        for ($i = 1; $i <= 31; $i++)
                                                        {
                                                            ?>    <li data-target="end_date" data-val="<?php echo $i < 10 ? "0" . $i : $i; ?>"><?php echo $i < 10 ? "0" . $i : $i; ?></li>
                                                            <?php
                                                        }
                                                    ?>
                                                </ul>
                                            </div>
                                            <input type="hidden" name="edate[]" id="end_date" value="<?php echo!empty($this->event_end_date->day[0]) ? $this->event_end_date->day[0] : "01"; ?>">

                                        </div>
                                        <p class="note">Date</p>
                                        <label for="end_date" generated="true" class="error note" style="display:none;">Date must be higher than current date</label>
                                    </div>
                                    <div class="fl">
                                        <div class="radius f-dropdown select">
                                            <p class="text"><?php echo!empty($this->event_end_date->month[0]) ? $this->event_end_date->month[0] : date('M', time()); ?></p>
                                            <a href="#" class="arrow"></a>
                                            <div class="dropdown">
                                                <ul>
                                                    <?php
                                                        for ($i = 0; $i < 12; $i++)
                                                        {
                                                            ?>
                                                            <li data-target="end_month" data-val ="<?php echo date('M', strtotime(' +' . $i . ' month', time())); ?>"><?php echo date('M', strtotime(' +' . $i . ' month', time())); ?></li>
                                                            <?php
                                                        }
                                                    ?>

                                                </ul>
                                            </div>
                                            <input type="hidden" name="emonth[]" id="end_month" value="<?php echo!empty($this->event_end_date->month[0]) ? $this->event_end_date->month[0] : date('M', time()); ?>">
                                        </div>
                                        <p class="note">Month</p>
                                    </div>
                                    <div class="fl">
                                        <div class="radius f-dropdown select">
                                            <p class="text"><?php echo!empty($this->event_end_date->year[0]) ? $this->event_end_date->year[0] : date('Y'); ?></p>
                                            <a href="#" class="arrow"></a>
                                            <div class="dropdown">
                                                <ul>
                                                    <?php
                                                        for ($i = 0; $i <= 5; $i++)
                                                        {
                                                            ?>    
                                                            <li data-target="end_year" data-val="<?php echo date("Y", strtotime('+' . $i . ' year', time())); ?>"><?php echo date("Y", strtotime('+' . $i . ' year', time())); ?></li>
                                                            <?php
                                                        }
                                                    ?>   
                                                </ul>
                                            </div>    
                                            <input type="hidden" name="eyear[]" id="end_year" value="<?php echo!empty($this->event_end_date->year[0]) ? $this->event_end_date->year[0] : date('Y'); ?>">
                                        </div> 
                                        <p class="note">Year</p>
                                    </div>
                                    <div class="cf"></div>

                                </div>
                            </div>
                            <div class="cf"></div>
                        </div>
                        <p><br /><br /><br /></p>
                        <div class="label">
                            <strong>Event <span class="blu">Info</span></strong>
                        </div>
                        <div class="field">
                            <div class="fl icon"><img src="<?php echo IMAGES_URL; ?>event-icon-blue.png" alt="active"></div>
                            <div class="f-input fl">
                                <textarea name="event_info" id="event_info" class="radius area" maxlength="1000" onfocus="this.style.borderColor = '#1996d4'" onblur="this.style.borderColor = '#cfcfcf'" style="border-color: rgb(207, 207, 207);"><?php echo stripslashes($this->event_info); ?></textarea>
                            </div>
                            <div class="cf"></div>
                            <div class="note">1000 characters max</div>
                        </div>
                        <div class="cf"></div>
                        <!--                <div class="field">
                                            <div class="button">
                                                <a href="#" class="bluefbutton fl">Next</a>
                                                <div class="cf"></div>
                                            </div>
                                        </div>-->


                    </div>



                    <div id="step2" class="step">


                        <div class="field">
                            <div class="fl icon"><img src="<?php echo IMAGES_URL; ?>edit-photo-blue.png" alt="active"></div>
                            <div class="f-input fl">
                                <div class="group-box radius glocation">
                                    <div class="title">Add <span class="blu">images</span></div>
                                    <div class="group-content gr-addimg post-content">
                                        <div class="browser radius">
                                            <input type="text" class="input" value="Browse" onclick="console.log($(this).next());$(this).next().click();">
                                            <input type="file" name="event_image[]" multiple="multiple" id="event_image"  class="file" onchange="$(this).prev().val($(this).val());
                                                   ">
                                            <input type="button" class="upload-button" value="Upload" />
                                        </div>
                                        <p class="note">4 images max</p>
                                        <div id="waiting-msg">
                                            <span class="hide">Please wait</span>
                                        </div>
                                        <div class="preview friends">
                                            <p><i>Preview:</i></p>
                                            <ul class="screen " id="fileDisplayArea">
                                                <?php
                                                    $dir_name = getEncryptedString($this->event_id);
                                                    if (is_dir(EVENT_IMAGE_PATH . "/" . $dir_name) && !empty($this->event_id))
                                                    {
                                                        $dir = new RecursiveDirectoryIterator(EVENT_IMAGE_PATH . "/" . $dir_name, FilesystemIterator::SKIP_DOTS);
// Flatten the recursive iterator, folders come before their files
                                                        $it = new RecursiveIteratorIterator($dir, RecursiveIteratorIterator::SELF_FIRST);
// Maximum depth is 1 level deeper than the base folder
                                                        $it->setMaxDepth(0);
// Basic loop displaying different messages based on file or folder
                                                        foreach ($it as $fileinfo)
                                                        {

                                                            if ($fileinfo->isFile())
                                                            {
                                                                echo "<li><a onclick='removeeventimage(this);return false;' href='" . $this->baseUrl("ajax/removeeventimage?url=" . urlencode(EVENT_IMAGE_PATH . "/" . $dir_name . "/" . $fileinfo->getFilename())) . "&id=" . $this->event_id . "' style='display:block;float:left;position:relative;'>";
                                                                echo "<img  src='" . $this->baseUrl(EVENT_IMAGE_PATH . "/" . $dir_name . "/" . $fileinfo->getFilename()) . "' width='82' height='46'>";
                                                                echo '<span class="bg" style="opacity: 0; display: block;"></span>';
                                                                echo '<span data-group="6" rel="4" class="icon del remove-friend" style="opacity: 0; display: block;" ></span>';
                                                                echo "</a></li>";
                                                            }
                                                        }
                                                    }
                                                ?> 
                                            </ul>
                                            <div class="cf"></div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                            <div class="cf"></div>
                        </div>
                        <p><br /><br /></p>
                        <div class="field">
                            <div class="fl icon"><img src="<?php echo IMAGES_URL; ?>video-icon.png" alt="active"></div>
                            <div class="f-input fl">
                                <div class="group-box radius glocation">
                                    <div class="title">Add <span class="blu">Video</span></div>
                                    <div class="group-content gr-addvideo">
                                        <div class="browser radius">
                                            <input type="text" name="event_video" id="event_video" class="input radius blu" onfocus="this.style.borderColor = '#1996d4';
                                        this.style.color = '#000';" onblur="this.style.borderColor = '#cfcfcf';
                                        this.style.color = '#1996d4';
                                                   " style="border-color: rgb(207, 207, 207);" placeholder="Type Url" value="<?php echo $this->event_video; ?>">
                                            <input class="upload-video-button ui-wizard-content ui-helper-reset ui-state-default" type="button" value="Upload">
                                            <p class="note">Only Youtube and Vimeo videos supported, to post media use the “share" url</p>
                                        </div>
                                        <div class="preview">
                                            <div class="t fl"><i>Preview:</i></div>
                                            <div class="fl video-prv">
                                                <?php
                                                    if (!empty($this->event_video))
                                                    {
                                                        $url = $this->event_video;
                                                        $video_details = getVideoServiceName($url);
                                                        $video_id = $video_details["video_id"];
                                                        $video_service = $video_details["video_service"];
                                                        $iframe_url = getVideoEmbedUrl($video_id, $video_service);
                                                        echo "<iframe src= 'http://www.youtube.com/embed/" . $iframe_url . "' width='333' height='204'></iframe>";

//                                                        $videoType = preg_match('/youtube/', $url);
//                                                        if ($videoType)
//                                                        {
//                                                            preg_match('/v=(.{11})/', $url, $match);
//                                                            echo "<iframe src= 'http://www.youtube.com/embed/" . $match[0] . "' width='333' height='204'></iframe>";
//                                                        }
//                                                        else
//                                                        {
//                                                            preg_match('/v=(.{11})/', $url, $match);
//                                                            echo "<iframe src= 'http://player.vimeo.com/video/" . $match[0] . "' width='333' height='204'></iframe>";
//                                                        }
                                                    }
                                                ?>
                                            </div>
                                            <div class="cf"></div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                            <div class="cf"></div>
                        </div>
                        <p><br /><br /></p>
                        <div class="field">
                            <div class="fl icon"><img src="<?php echo IMAGES_URL; ?>type-icon.png" alt="active"></div>
                            <div class="f-input fl">
                                <div class="group-box radius">
                                    <div class="title">Type</div>
                                    <div class="group-content">
                                        <div class="gcleft fl">
                                            <label class="blu fl radio">
                                                <input type="radio" name="event_type" value="public" <?php echo $this->event_type != 'private' ? 'checked="checked"' : ""; ?>><span><i>Public</i></span>
                                                <span class="rnote"><i>This event is open for anyone to join.</i></span>
                                            </label>
                                            <div class="cf"></div>
                                            <p><br /></p>
                                            <label class="blu fl radio">
                                                <input type="radio" name="event_type" value="private" <?php echo $this->event_type == 'private' ? 'checked="checked"' : ""; ?>><span><i>Private</i></span>
                                                <span class="rnote"><i>This event will require a request to join.</i></span>
                                            </label>
                                            <div class="cf"></div>
                                        </div>
                                        <div class="cf"></div>
                                    </div>
                                </div>
                            </div>
                            <div class="cf"></div>
                        </div>
                        <p><br /><br /></p>
                        <div class="field">
                            <div class="fl icon"><img src="<?php echo IMAGES_URL; ?>star-icon.png" alt="active"></div>
                            <div class="f-input fl">
                                <div class="group-box radius grcevent">
                                    <div class="title">Celebrity <span class="blu">Event</span></div>
                                    <div class="group-content">
                                        <div class="coption">
                                            <div class="fl yno">
                                                <a href="#" class="fl l <?php echo $this->event_celebrity_event == '1' ? 'a' : ''; ?>" rel="1" data-target="event_celebrity_event">Yes</a>
                                                <a href="#" class="fl r <?php echo $this->event_celebrity_event != '1' ? 'a' : ''; ?>" rel="0" data-target="event_celebrity_event">No</a>
                                            </div>
                                            <div class="fl txt">Is this a Celebrity Event?</div>
                                            <div class="cf"></div>
                                        </div>
                                        <div class="note">
                                            All Celebrity Events submitted will be pending for review
                                        </div>
                                        <input type="hidden" name="event_celebrity_event" id="event_celebrity_event"  value="<?php echo!empty($this->event_celebrity_event) ? $this->event_celebrity_event : '0'; ?>">
                                    </div>
                                </div>
                            </div>
                            <div class="cf"></div>
                        </div>
                        <div class="field summary">
                            <p>The Event you created includes selling tickets. Please read the <a href="#" class="tlink blu">Quick Ties Fees and Policy</a>. If you want to remove selling tickets, please check the <a href="#" class="tlink blu">â€œNoâ€�</a> button above. </p>
                        </div>
                        <div class="field agree-term">
                            <div class="chk"><input type="checkbox" id="agree" name="agree"/> My event adheres to Quick-ties terms and policies</div>
                            <div class="cf"></div>
                        </div>
                        <p><br /></p>

                    </div>
                    <div id="demoNavigation"> 
                        <div class="field">
                            <p><br /></p>
                            <div class="buttons-ce">

                                <button type="reset" class="yefbutton fl back" id="back">Back</button>
                                <button type="submit" id="next" class="bluefbutton fr prev">Next</button>

                                <div class="cf"></div>
                            </div>
                            <p><br /></p>    
                        </div>
                    </div>
                </form>       
            </div>          
        </div>


        <?php echo $this->partial('extra/right-ad-sidebar.phtml', array('ads_count' => 3)) ?>


    </div>
</div>

<script type="text/html" id="recurring_date">
    <div id="recurr-">
    <p><br><br></p>
    <div class="fl">
    <div class="radius f-dropdown select">
    <p class="text">01</p>
    <a href="#" class="arrow"></a>
    <div class="dropdown">
    <ul>
    <?php
        for ($i = 1; $i <= 31; $i++)
        {
            ?>    <li data-target="recurring_date_" data-val="<?php echo $i < 10 ? "0" . $i : $i; ?>"><?php echo $i < 10 ? "0" . $i : $i; ?></li>
            <?php
        }
    ?>
    </ul>
    </div>
    <input type="hidden" name="date[]" id="recurring_date_">
    </div>
    <p class="note">Date</p>
    </div>
    <div class="fl">
    <div class="radius f-dropdown select">
    <p class="text"><?php echo date("M", time()); ?></p>
    <a href="#" class="arrow"></a>
    <div class="dropdown">
    <ul>
    <li data-target="recurring_month_" data-val="<?php echo date("M", strtotime('+' . $i . ' month', time())); ?>"><?php echo date("M", strtotime('+' . $i . ' month', time())); ?></li>
    </ul>
    </div>
    <input type="hidden" name="month[]" id="recurring_month_">
    </div>
    <p class="note">Month</p>
    </div>
    <div class="fl">
    <div class="radius f-dropdown select">
    <p class="text"><?php echo date('Y'); ?></p>
    <a href="#" class="arrow"></a>
    <div class="dropdown">
    <ul>
    <?php
        for ($i = 0; $i <= 5; $i++)
        {
            ?>    
            <li data-target="recurring_year_" data-val="<?php echo date("Y", strtotime('+' . $i . ' year', time())); ?>"><?php echo date("Y", strtotime('+' . $i . ' year', time())); ?></li>
            <?php
        }
    ?>   
    </ul>
    </div>    
    <input type="hidden" name="year[]" id="recurring_year_">
    </div> 
    <p class="note">Year</p>
    </div>
    <a href="#" rel="recurr-" class="remove-date"><img src="<?php echo IMAGES_PATH; ?>/del-msg-icon.png"/></a>
    <div class="cf"></div>
    </div>

</script>
<script type="text/javascript" src="<?php echo JS_PATH; ?>/jquery.form.js"></script>
<script type="text/javascript" src="<?php echo JS_PATH; ?>/jquery.validate.js"></script>
<script type="text/javascript" src="<?php echo JS_PATH; ?>/bbq.js"></script>
<script type="text/javascript" src="<?php echo JS_PATH; ?>/jquery.form.wizard.js"></script>
<script type="text/javascript" src="<?php echo JS_PATH; ?>/ajaxfileupload.js"></script>
<script type="text/javascript">
                                    $(function() {
                                        var form = $("#demoForm");

                                        // hide/show the button appropriately when a step is shown
                                        form.bind("step_shown", function(e, data) {
                                            if (data != undefined && !data.isFirstStep) {
                                                form.find(":reset").show();
                                                form.find("#next").html("Submit");
                                                form.find("#next").addClass("submit-now");
                                            } else {
                                                form.find(":reset").hide();
                                                form.find("#next").html("Next");
                                                form.find("#next").removeClass("submit-now");
                                            }
                                        });

                                        $(".submit-now").live("click", function(event) {

                                        });

                                        $("#demoForm").formwizard({
                                            formPluginEnabled: true,
                                            validationEnabled: true,
                                            focusFirstInput: true,
                                            formOptions: {
                                                success: function(data) {


                                                    //Alert(data.message); 
                                                    $(".please-wait").show();
                                                    window.location.href = baseUrl + "/eventdetail/" + data.encrypted_event_id;
                                                }, //$("#status").fadeTo(500,1,function(){ $(this).html("You are now registered!").fadeTo(5000, 0); })},

                                                //beforeSubmit: function(data){$("#data").html("data sent to the server: " + $.param(data));},
                                                dataType: 'json',
                                                resetForm: true,
                                                error: function(xhr, textStatus, errorThrown) {
                                                    console.log(xhr, textStatus, errorThrown);
                                                }
                                            },
                                            validationOptions: {
                                                rules: {
                                                    event_title: "required",
                                                    event_cat_id: "required",
                                                    event_group_size: {
                                                        required: "#event_group_type_limited:checked"
                                                    },
                                                    event_address: "required",
                                                    event_city: "required",
                                                    event_state: "required",
                                                    event_country: "required",
                                                    agree: "required",
                                                    "sdate[]": "dateHigherThanToday",
                                                    "edate[]": "dateHigherThanToday1"
                                                }
                                            },
                                            error: function(xhr, textStatus, errorThrown) {
                                                console.log("in ajaxForm error");
                                            }
                                        }).trigger("step_shown"); // trigger once at page load

                                        $(".remove-date").live("click", function(event) {
                                            event.preventDefault();
                                            var id = $(this).attr("rel");
                                            $("#" + id).remove();
                                        });

                                        $("input[name='event_group_type']").change(function() {
                                            var radio_value = $(this).val();
                                            if (radio_value == "unlimited")
                                            {
                                                $("#event_group_size").val("");
                                                $("#event_group_size").attr("disabled", "disabled");
                                            }
                                            else
                                            {
                                                $("#event_group_size").removeAttr("disabled");
                                            }
                                        });

                                        $('input#event_country').typeahead({
                                            name: 'event_country',
                                            prefetch: '<?php echo $this->baseUrl("ajax/getallcountriescsv"); ?>',
                                        });

                                        $('input#event_city').typeahead({
                                            name: 'event_city',
                                            prefetch: '<?php echo $this->baseUrl("ajax/getallcitiescsv"); ?>',
                                        });

//        $('input#event_subcat_id').typeahead({
//            name: 'event_subcat_id',
//            prefetch: '<?php echo $this->baseUrl("ajax/getallsubcategoriescsv"); ?>',
//        });


                                        $(document).ready(function(e) {

                                            $('.dropdown ul li').click(function() {
                                                var cat_id = $(this).attr("data-val");
                                                $.ajax({
                                                    type: "POST",
                                                    url: "<?php echo $this->baseUrl("ajax/getallsubcategoriescsv"); ?>" + "/cat_id/" + cat_id,
                                                    dataType: "json",
                                                    data: "{}",
                                                    contentType: "application/json; charset=utf-8",
                                                    success: function(data) {
                                                        $('input#event_subcat_id').autocomplete({
                                                            minLength: 0,
                                                            source: data,
                                                            focus: function(event, ui) {

                                                                $('input#event_subcat_id').val(ui.item.value);
                                                                return false;
                                                            },
                                                            select: function(event, ui) {
                                                                $('input#event_subcat_id').val(ui.item.value);
                                                                $('#selectedValue').text("Selected value:" + ui.item.Abbreviation);
                                                                return false;
                                                            }
                                                        });
                                                    }
                                                });
                                            });


                                        });



                                        //date validation
                                        $.validator.addMethod("dateHigherThanToday", function(value, element) {
                                            //If false, the validation fails and the message below is displayed
                                            var day = $('#single_date').val();
                                            var month = getDateNumber($('#single_month').val());
                                            var year = $('#single_year').val();


                                            var chckDate = new Date(year, parseInt(month), day);


                                            var q = new Date();
                                            var m = q.getMonth();
                                            var d = q.getDate();
                                            var y = q.getFullYear();


                                            //alert('not valid');

                                            return chckDate >= new Date(y, m, d);
                                        }, "Date must be higher than current date");

                                        $.validator.addMethod("dateHigherThanToday1", function(value, element) {
                                            //If false, the validation fails and the message below is displayed
                                            var day = $('#end_date').val();
                                            var month = getDateNumber($('#end_month').val());
                                            var year = $('#end_year').val();
                                            var chckDate = new Date(year, parseInt(month), day);

                                            var q = new Date();
                                            var m = q.getMonth();
                                            var d = q.getDate();
                                            var y = q.getFullYear();

                                            return chckDate >= new Date(y, m, d);
                                        }, "Date must be higher than current date");


                                        //ajax file uploader


                                        $(document).on("change", '#event_image', function(ev) {
                                            
                                            $('#waiting-msg .hide').css('display','block');
                                            $.ajaxFileUpload({
                                                url: baseUrl + '/ajax/doajaxfileupload<?php echo!empty($this->event_id) ? "/event_id/" . $this->event_id : ""; ?>',
                                                secureuri: false,
                                                fileElementId: 'event_image',
                                                dataType: 'json',
                                                data: {id: user_id},
                                                success: function(data, status)
                                                {
                                                    $('#waiting-msg .hide').css('display','none');
                                                    var fileDisplayArea = document.getElementById('fileDisplayArea');
                                                    if (!data.error) {

                                                        for (var i in data.filename) {

                                                            var img = new Image();
                                                            img.src = baseUrl + "/resources/temp/" + user_id + "/" + data.filename[i];
                                                            img.width = 82;
                                                            img.height = 46;

                                                            var src = baseUrl + "/resources/temp/" + user_id + "/" + data.filename[i];
                                                            //add to li
                                                            //var input = $('<input type="hidden" name="event_image_file[]" value="'+reader.result+'">');
                                                            var span = '<li><a href="' + baseUrl + '/ajax/removeeventimage" data-user = "' + user_id + '" data-file="' + data.filename[i] + '"  onclick="removetempimage(this);return false;"><img src="' + src + '" width="82" height=46"><span class="bg" style="opacity: 0; display: block;"></span><span data-group="6" rel="4" class="icon del remove-friend" style="opacity: 0; display: block;" ></span></a></li>';

                                                            $('#fileDisplayArea').append(span);
                                                            //fileDisplayArea.appendChild(span);
                                                        }
                                                        //console.log($('.event_image').get(0));
                                                        $('#event_image').prev().val('Browse');
                                                    } else {
                                                        Alert(data.error, "Alert message");
                                                    }
                                                },
                                                error: function(data, status, e)
                                                {
                                                    alert(e);
                                                }
                                            });

                                        });

                                        $(".upload-video-button").click(function(event) {
                                        event.preventDefault();
                                            var video_url = $("#event_video").val();

                                            if (video_url != "")
                                            {
                                                $.ajax({
                                                    type: "post",
                                                    url: "<?php echo $this->baseUrl("ajax/getvideopreview"); ?>",
                                                    data: {"video_url": video_url},
                                                    success: function(response) {
                                                        $(".video-prv").html(response);
                                                    }
                                                });

                                            }
                                        });


                                    });
</script>
